package com.flyduck.system.vo.dept.trans;


import cn.hutool.core.bean.BeanUtil;
import com.flyduck.system.entity.SysDeptEntity;
import com.flyduck.system.vo.dept.SysDeptTreeSelectRespVO;
import com.google.common.base.Function;


/**
 * @program: flyduck-platform
 * @description:
 * @author: flyduck
 * @create: 2021-02-01 12:42
 **/
public class SysDeptEntityToSysDeptTreeSelectRespVO implements Function<SysDeptEntity, SysDeptTreeSelectRespVO> {

    @Override
    public SysDeptTreeSelectRespVO apply(SysDeptEntity sysDeptEntity) {
        SysDeptTreeSelectRespVO sysDeptTreeSelectRespVO = new SysDeptTreeSelectRespVO();
        BeanUtil.copyProperties(sysDeptEntity,sysDeptTreeSelectRespVO);
        sysDeptTreeSelectRespVO.setId(sysDeptEntity.getId()+"");
        sysDeptTreeSelectRespVO.setParentId(sysDeptEntity.getParentId()+"");
        sysDeptTreeSelectRespVO.setSort(sysDeptEntity.getSort()+"");
        return sysDeptTreeSelectRespVO;
    }
}
